package com.dk.mq;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dk.service.item.ItemPageService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "dongdongshop",consumerGroup = "item-consumer")
public class RocketMqConsoumer implements RocketMQListener<Object> {

    @Reference
    private ItemPageService itemPageService;

    @Override
    public void onMessage(Object o) {
        Long goodsId = (Long) o;
        itemPageService.freemarkerItemPage(goodsId);
    }
}
